V2EX  ›  英汉词典

Balanced Parentheses

释义 Definition

“Balanced parentheses” 指“括号配对/括号平衡”:在一段表达式或文本中,每一个左括号 ( 都能在正确的顺序与层级上对应到一个右括号 **)**,并且不会出现多余或缺失的括号。常见于数学表达式、编程语法、数据结构与解析(parsing)问题中。

发音 Pronunciation (IPA)

/ˈbælənst pəˈrɛnθəsiːz/

例句 Examples

Check your code for balanced parentheses before you run it.
运行前先检查你的代码里括号是否配对。

The parser validates the input by ensuring all nested expressions have balanced parentheses and matching scope.
解析器通过确保所有嵌套表达式的括号平衡并且作用域匹配来验证输入。

词源 Etymology

“Balanced” 来自 “balance(平衡)”,表示“数量与结构上对称、相互对应”;“parentheses” 来自希腊语词根(与“放在旁边/插入说明”相关),在现代英语中指圆括号 **( )**。组合成短语后,就用来描述括号在结构上“成对出现、嵌套正确”的状态。

相关词 Related Words

文学与著作 Literary Works

  • Introduction to Algorithms(CLRS)——在栈(stack)与语法结构相关内容中常以“括号匹配/括号平衡”作为典型应用示例。
  • The Art of Computer Programming(Donald E. Knuth)——在算法与形式结构的讨论中涉及括号结构与表达式表示。
  • Structure and Interpretation of Computer Programs(SICP)——在表达式求值、递归与语法表示等主题中常出现括号结构与其正确嵌套的讨论。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   1916 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 02:32 · PVG 10:32 · LAX 18:32 · JFK 21:32
♥ Do have faith in what you're doing.